<template>
  <view class="home">
    <view class="nav-title">
      <image src="/static/images/localShop/icon_more.png" @click="handleBack" mode=""></image>
      收款码
    </view>
    <view class="subtract-box">
      <image src="/static/images/bank/Subtract.png" class="subtract-img" mode=""></image>
      <view class="subtract-title">
        <image :src="shopInfo.user.avatar" mode=""></image>
        <text>合作商家</text>
      </view>
      <view class="shop-title">{{shopInfo.user.nickname}}</view>
      <view class="shop-desc">{{shopInfo.city}}{{shopInfo.address}}</view>
      <view class="shop-desc">{{shopInfo.mobile}}</view>
      <image :src="shopInfo.qrcode" class="shop-img" mode=""></image>
      <view class="shop-img-text">易货额收款二维码</view>
    </view>
  </view>
</template>

<script>
  import { mapState } from 'vuex'
  export default {
    data() {
      return {
        shopInfo: {
          user: {}
        }
      }
    },
    computed: {
      ...mapState(['user'])
    },
    onLoad() {
      this.myShopInfo()
    },
    methods: {
      myShopInfo() {
        uni.request({
          url: "/wanlshop/shop/myShopInfo",
          method: 'GET',
          success: ({ res }) => {
            console.log(res)
            this.shopInfo = res.data
          }
        })
      },
      handleBack() {
        uni.navigateBack()
      }
    }
  }
</script>

<style scoped lang="scss">
  .home {
    background: #FFBE52;
    min-height: 100vh;
  }

  .nav-title {
    text-align: center;
    color: #fff;
    font-size: 36rpx;
    font-weight: 800;
    height: 88rpx;
    line-height: 88rpx;
    position: relative;

    image {
      width: 48rpx;
      height: 48rpx;
      filter: brightness(2);
      position: absolute;
      left: 20rpx;
      transform: rotate(180deg);
      top: 0;
      bottom: 0;
      margin: auto;

    }
  }

  .subtract-box {
    position: relative;
    z-index: 1;
    width: 700rpx;
    height: 1140rpx;
    margin: 50rpx auto;

    .subtract-img {
      z-index: -1;
      width: 100%;
      height: 100%;
      position: absolute;
    }

    .subtract-title {
      display: flex;
      align-items: center;
      justify-content: center;
      color: #333;
      font-weight: 800;
      font-size: 40rpx;
      padding-top: 60rpx;

      image {
        width: 290rpx;
        height: 64rpx;
        margin-right: 32rpx;
      }

      text {
        position: relative;
        padding-left: 32rpx;
      }

      text::before {
        height: 30rpx;
        width: 1rpx;
        background-color: #999999;
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        margin: auto;
      }
    }

    .shop-title {
      font-weight: bold;
      font-size: 38rpx;
      color: #333333;
      text-align: center;
      margin: 80rpx 0 30rpx;
    }

    .shop-desc {
      font-weight: 600;
      font-size: 28rpx;
      color: #333333;
      padding-left: 78rpx;
      margin-bottom: 14rpx;
    }

    .shop-desc::before {
      content: '';
      display: inline-block;
      width: 24rpx;
      height: 24rpx;
      border-radius: 50%;
      margin-right: 18rpx;
      background: #ff5a00;

    }

    .shop-img {
      width: 600rpx;
      height: 600rpx;
      margin: 22rpx auto;
      display: block;
    }

    .shop-img-text {
      font-weight: bold;
      font-size: 36rpx;
      color: #000000;
      text-align: center;
    }
  }
</style>